package thread;

public class DaemonThreadDemo {
    public static void main(String[] args) {
        Thread rose = new Thread(){
            @Override
            public void run() {
                for (int i=0;i<5;i++){
                    System.out.println("rose:let me go!");
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                    }
                }
                System.out.println("rose:啊啊啊啊啊啊啊啊AAAAAAAAAaaaaaaaaaaa");
                System.out.println("扑通！！！");
            }
        };
        Thread jock = new Thread(){
            @Override
            public void run() {
                while (true){
                    System.out.println("jock:you jump ! i jump !");
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                    }
                }
            }
        };
        rose.start();
        jock.setDaemon(true);
        jock.start();

        while (true);
    }
}
